/*
 * @Author: Jimmy
 * @LastModifiedBy: Jimmy
 * @Date: 2024-06-30 20:35:53
 * @LastEditTime: 2024-07-07 11:20:39
 * @FilePath: /nest_study/server/src/modules/system/dict/entities/dict.data.entity.ts
 */
import { ApiProperty } from "@nestjs/swagger";
import { BaseEntity } from "src/common/entites/base";
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity('sys_dict_data', {
    comment: '字典数据表'
})
export class SystemDictDataEntity extends BaseEntity {
    @ApiProperty({ type: Number, description: '字典主键' })
    @PrimaryGeneratedColumn({
        type: 'int',
        name: 'dict_id',
        comment: '字典主键'
    })
    public id: number

    @Column({ type: 'varchar', name: 'dict_label', length: 100, comment: '字典标签' })
    public label: string;

    @Column({ type: 'varchar', name: 'dict_value', length: 100, comment: '字典键值' })
    public value: string;

    @Column({ type: 'varchar', name: 'dict_parent', length: 100, comment: '父级字典编码' })
    public parent: string;

    //样式属性（其他样式扩展）
    @Column({ type: 'varchar', name: 'css_class', length: 100, default: '', comment: '样式属性' })
    public class: string;

    @Column({ type: 'int', name: 'dict_sort', default: 0, comment: '字典排序' })
    public sort: number;
}